{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e9735fe0-f1ac-430f-826e-f95396666501",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html>\\(\\displaystyle 6.62607015 \\times 10^{-34}\\)</html>"
      ],
      "text/latex": [
       "$\\displaystyle 6.62607015 \\times 10^{-34}$"
      ],
      "text/plain": [
       "6.62607015e-34"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<html>\\(\\displaystyle 1.602176634 \\times 10^{-19}\\)</html>"
      ],
      "text/latex": [
       "$\\displaystyle 1.602176634 \\times 10^{-19}$"
      ],
      "text/plain": [
       "1.602176634e-19"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<html>\\(\\displaystyle 299792458.0\\)</html>"
      ],
      "text/latex": [
       "$\\displaystyle 299792458.0$"
      ],
      "text/plain": [
       "299792458.0"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(6.62607015e-34, 'J Hz^-1', 0.0)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 物理常数调用\n",
    "from scipy import constants as const\n",
    "show(const.h)\n",
    "show(const.e)\n",
    "show(const.c)\n",
    "# 这里可以看更多\n",
    "const.physical_constants[\"Planck constant\"] \n",
    "# 上面这个是量子力学的，咱这里要电动力学的"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c086807-c01a-4522-a0de-62c27b46f5f0",
   "metadata": {},
   "source": [
    "电动力学的常数，真空中的……好吧直接看后面常数表\n",
    "\n",
    "* 真空中光速\n",
    "* 真空介电常数\n",
    "* 真空磁导率\n",
    "* 电子电荷\n",
    "* 电子质量 kg与MeV/c^2 两种（后面的质量也是）\n",
    "* 质子质量\n",
    "* 中子质量\n",
    "* 氚核质量\n",
    "* 氚的结合能\n",
    "* 氢原子玻尔半径\n",
    "* 氢原子结合能\n",
    "* 普朗克常量\n",
    "* 电子伏特\n",
    "\n",
    "另：physical constant命令给出的元组，单位后面找点办法用起来吧？\n",
    "\n",
    "此外附录2有提到高斯单位制……不晓得sagemath搞不搞得出来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "54bd8bb0-134f-4d15-a550-95889181d555",
   "metadata": {},
   "outputs": [],
   "source": [
    "def print_const(中文名,符号,英文常量索引):\n",
    "    result = const.physical_constants[英文常量索引]\n",
    "    print(中文名+\"(\"+符号+\")：\"+'{:e}'.format(result[0])+' ('+result[1]+')')\n",
    "\n",
    "def print_consts(arg_list):\n",
    "    for i in arg_list:\n",
    "        print_const(i[0],i[1],i[2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "13905803-bff6-488b-a529-b08a526479d9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Avogadro constant : (6.02214076e+23, 'mol^-1', 0.0)\n"
     ]
    }
   ],
   "source": [
    "for i in const.physical_constants:\n",
    "    if '' in i:\n",
    "        if 'mol^-1' == const.physical_constants[i][1]:\n",
    "            print(i+' : '+str(const.physical_constants[i]))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "SageMath 10.5",
   "language": "sage",
   "name": "sagemath"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
